package com.qisu.converters;

import org.springframework.stereotype.Component;

/**
 *
 * @author alsan
 *
 */
@Component
public final class ByteConverter implements FieldConverter<Byte> {

	@Override
	public Byte converter(byte[] data, int pos, int len) {
		if(null != data && data.length > 0) {
			return data[pos];
		}
		return null;
	}

	@Override
	public Byte converter(byte[] data) {
		return converter(data, 0, 1);
	}

}
